cmake_minimum_required (VERSION 2.8)

set( TARGET_NAME test_bmock )

set(SOURCES
	bmock_control_tools_mock.cpp
	test_arguments_validation.cpp
	test_arguments_validation_newmocks.cpp
	test_warnings.cpp
	test_warnings_newmocks.cpp
	test_callback.cpp
	test_callback_newmocks.cpp
	test_class_methods.cpp
	test_class_methods_newmocks.cpp
	test_default_arguments.cpp
	test_default_arguments_newmocks.cpp
	test_exceptions.cpp
	test_exceptions_newmocks.cpp
	test_function_call.cpp
	test_function_call_newmocks.cpp
	test_func_info.cpp
	test_ignore.cpp
	test_ignore_newmocks.cpp
	test_in_out_ptr.cpp
	test_in_out_ptr_newmocks.cpp
	test_multithreaded.cpp
	test_multithreaded_newmocks.cpp
	test_non_static_function_pointers.cpp
	test_non_static_function_pointers_newmocks.cpp
	test_non_strict_expectations.cpp
	test_non_strict_expectations_newmocks.cpp
	test_null_pointers.cpp
	test_null_pointers_newmocks.cpp
	test_raw_buf_arg.cpp
	test_raw_buf_arg_newmocks.cpp
	test_reference_to_abstract_class.cpp
	test_reference_to_abstract_class_newmocks.cpp
	test_return_value.cpp
	test_return_value_newmocks.cpp
	test_scoped_expect.cpp
	test_scoped_expect_newmocks.cpp
	test_serialization.cpp
	test_serialization_newmocks.cpp
	test_static_dynamic_mocks_combined.cpp
	test_stub.cpp
	test_stub_newmocks.cpp
	test_template_functions.cpp
	test_unused_arguments.cpp
	test_unused_arguments_newmocks.cpp
	test_update_arguments.cpp
	test_update_arguments_advanced.cpp
	test_update_arguments_advanced_newmocks.cpp
	test_update_arguments_newmocks.cpp
	test_update_string_argument.cpp
	test_update_string_argument_newmocks.cpp
)

set(HEADERS	
	bmock_control_tools_mock.hpp
	stdafx.h
)

ADD_MSVC_PRECOMPILED_HEADER( stdafx.h stdafx.cpp SOURCES )

add_executable( ${TARGET_NAME} ${SOURCES} ${HEADERS} )

add_dependencies( ${TARGET_NAME} bmock test_bmock_raw_mem test_bmock_argument test_bmock_expectation )

target_link_libraries( ${TARGET_NAME} bmock ) 
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
	target_link_libraries( ${TARGET_NAME} pthread boost_system boost_signals boost_test_exec_monitor boost_regex boost_thread )
endif()

get_target_property(OUTPUT_FULL ${TARGET_NAME} LOCATION)
add_custom_command( TARGET ${TARGET_NAME} POST_BUILD 
	COMMAND ${OUTPUT_FULL} --build_info=no --result_code=no --show_progrss=no --catch_system_errors=yes --detect_memory_leak=1 --report_level=no  --log_level=warning
)
